package com.bourse.core.services.utils;

import java.util.HashMap;
import java.util.Map;

import com.bourse.core.utils.IsinCode;

public class IsinCodeFactory {

	private static IsinCodeFactory INSTANCE; 
	
	private Map<String, IsinCode> isinCodeMap = new HashMap<String, IsinCode>();
	
	
	private IsinCodeFactory(){		
	}
	
	
	public static IsinCodeFactory getInstance(){
		if(INSTANCE==null){
			INSTANCE = new IsinCodeFactory();
		}
		return INSTANCE;
	}
	
	
	public IsinCode getIsinCode(String isin){
		IsinCode isinCode = isinCodeMap.get(isin);
		if(isinCode==null){
			isinCode = new IsinCode(isin);
			isinCodeMap.put(isin, isinCode);
		}
		return isinCode;
	}
	
}
